// Operator

Used to add comments to code.


Syntax

// text string


Notes

REALbasic's compiler will ignore any comments you enter following the // operator. Comments are not included in stand-alone applications.

The ' (apostrophe) or Rem statement can be used to comment code as well. Comments can appear on separate lines or on the same line as executable code, provided they are to the right of any code that will execute. Valid comments appear in the Code Editor in red.

The Control-' keyboard shortcut (Command-' on Macintosh) toggles the selected lines of code between commented out and 'live' states. The Code Editor toolbar has a Comment button which switches the selected line or lines into a comment line. When the selected line or lines are commented out, this button changes to Uncomment. Clicking Uncomment changes the lines into executable code.


Example

The following code uses comments to document the results of Boolean comparisons:

Dim a As Boolean
Dim b As Boolean
Dim c As Boolean
Dim d As Boolean
a= True
b= False
d=a Or b // Evaluates to True
d=b And c // Evaluates to False

See Also

Rem statement; ' operator.